//
//  DYShopHeadlinesCell.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/17.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYShopHeadlinesCell.h"

@interface DYShopHeadlinesCell ()

@property (nonatomic,strong)UIView *dot1;
@property (nonatomic,strong)UIView *dot2;
@property (nonatomic,strong)UIView *dot3;
@property (nonatomic,strong)UIView *dot4;
@property (nonatomic,strong)UILabel *idLabel;
@property (nonatomic,strong)UILabel *typeLabel;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *statusLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UILabel *timeLabel;
@property (nonatomic,strong)UIButton *seeButton;

@end


@implementation DYShopHeadlinesCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.hideSeparatorLabel=YES;
    [self xhq_noneSelectionStyle];
    
    self.dot1 = ({
        UIView *view=[[UIView alloc]init];
        view.backgroundColor=[UIColor xhq_base];
        [view xhq_cornerRadius:BILIWIDTH(3)];
        view;
    });
    
    self.dot2 = ({
        UIView *view=[[UIView alloc]init];
        view.backgroundColor=[UIColor xhq_red];
        [view xhq_cornerRadius:BILIWIDTH(3)];
        view;
    });
    
    self.dot3 = ({
        UIView *view=[[UIView alloc]init];
        view.backgroundColor=[UIColor xhq_base];
        [view xhq_cornerRadius:BILIWIDTH(3)];
        view;
    });
    
    self.dot4 = ({
        UIView *view=[[UIView alloc]init];
        view.backgroundColor=[UIColor xhq_red];
        [view xhq_cornerRadius:BILIWIDTH(3)];
        view;
    });
    
    self.idLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_aTitle] alignment:0];
        label;
    });
    
    self.typeLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_aTitle] alignment:0];
        label;
    });
    
    self.titleLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_aTitle] alignment:0];
        label.lineBreakMode=NSLineBreakByTruncatingTail;
        label.numberOfLines=1;
        label;
    });
    
    self.statusLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_base] alignment:0];
        label;
    });
    
    self.lineLabel = ({
        UILabel *line=[UILabel xhq_lineLabel];
        line;
    });
    
    self.timeLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:12 textColor:[UIColor xhq_assist] alignment:0];
        label;
    });
    
    self.seeButton = ({
        UIButton *button=[Utils createBtnWithType:UIButtonTypeCustom backgroundColor:ClearColor action:@selector(seeButtonClick) target:self title:@"查看详情  " image:@"arrow_right" font:12 textColor:[UIColor xhq_content]];
        button;
    });
    
    
    [self addSubview:self.dot1];
    [self addSubview:self.dot2];
    [self addSubview:self.dot3];
    [self addSubview:self.dot4];
    [self addSubview:self.idLabel];
    [self addSubview:self.typeLabel];
    [self addSubview:self.titleLabel];
    [self addSubview:self.statusLabel];
    [self addSubview:self.lineLabel];
    [self addSubview:self.timeLabel];
    [self addSubview:self.seeButton];
    
    
    [self.dot1 makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(10));
        make.top.equalTo(BILIHEIGHT(15));
        make.width.height.equalTo(BILIWIDTH(6));
    }];
    
    [self.dot2 makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(kScreenWidth/2-BILIWIDTH(6));
        make.centerY.equalTo(self.dot1);
        make.width.height.equalTo(self.dot1);
    }];
    
    [self.dot3 makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dot1);
        make.top.equalTo(self.dot1.bottom).offset(BILIHEIGHT(22));
        make.width.height.equalTo(self.dot1);
    }];
    
    [self.dot4 makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dot2);
        make.centerY.equalTo(self.dot3);
        make.width.height.equalTo(self.dot1);
    }];
    
    [self.idLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dot1.right).offset(BILIWIDTH(3));
        make.right.equalTo(self.dot2.left).offset(BILIWIDTH(-3));
        make.centerY.equalTo(self.dot1);
    }];
    
    [self.typeLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dot2.right).offset(BILIWIDTH(3));
        make.right.equalTo(BILIWIDTH(-10));
        make.centerY.equalTo(self.dot2);
    }];
    
    [self.titleLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dot3.right).offset(BILIWIDTH(3));
        make.right.equalTo(self.idLabel);
        make.centerY.equalTo(self.dot3);
    }];
    
    [self.statusLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.typeLabel);
        make.centerY.equalTo(self.dot4);
    }];
    
    [self.lineLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(10));
        make.width.equalTo(kScreenWidth-BILIWIDTH(20));
        make.top.equalTo(self.dot3.bottom).offset(BILIHEIGHT(15));
        make.height.equalTo(BILIWIDTH(0.7));
    }];
    
    [self.timeLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.dot1);
        make.top.equalTo(self.lineLabel).offset(BILIHEIGHT(9));
        make.right.equalTo(self).offset(BILIWIDTH(-160));
    }];
    
    [self.seeButton makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(BILIWIDTH(-10));
        make.height.equalTo(BILIHEIGHT(25));
        make.centerY.equalTo(self.timeLabel);
    }];
    
    [self.seeButton placeImageTitlePosition:ZYButtonImagePositionRight space:BILIWIDTH(0)];
    
    self.idLabel.text=@"ID:2342";
    self.titleLabel.text=@"和给黑给个和个和你好啊昂河谷范儿风格如果";
    self.typeLabel.text=@"类别：攻略";
    self.statusLabel.text=@"审核状态：审核通过";
    
    self.statusLabel.attributedText=[DYAppCommon getRange:NSMakeRange(0, @"审核状态：".length) labelStr:self.statusLabel.text Font:self.statusLabel.font Color:[UIColor xhq_aTitle]];
    
    self.timeLabel.text=@"发布时间：2019-08-12";
}
-(void)seeButtonClick
{
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
